import request from "@/utils/request";
import type { SkuItem, SkuList } from "@/api/product/model/skuModel";

enum Api {
  addSaveSkuInfoUrl = "/admin/product/saveSkuInfo",
  getFindBySpuIdUrl = "/admin/product/findBySpuId",
}

export const addSaveSkuInfoApi = (data: SkuItem) => {
  return request.post<any, null>(Api.addSaveSkuInfoUrl, data);
};

// 获取sku属性接口函数
export const getFindBySpuIdApi = (spuId: number) => {
  return request.get<any, SkuList>(Api.getFindBySpuIdUrl + `/${spuId}`);
};
